package com.frogs.ucenter.v1.service;

import java.util.List;
import java.util.Map;

import javax.servlet.http.HttpServletRequest;

import org.springframework.web.multipart.MultipartFile;

import com.frogs.system.web.api.request.Request;
import com.frogs.system.web.api.response.Response;

public interface UploadService {
	/**
	 * 上传图片服务类，返回上传成功的路径
	 * @param request
	 * @param basicPath
	 * @param urlBasicPath
	 * @param domain
	 * @return
	 * @throws Exception 
	 */
	List<Map<String, String>> uploadImages(HttpServletRequest httpRequest,String basicPath,String urlBasicPath,String domain,Request request) throws Exception;
	
	/**
	 * 执行图片上传操作
	 * @param request
	 * @return
	 */
	Response doUploadImg(HttpServletRequest httpRequest,Request request) throws Exception;
	
	/**
	 * 获取已上传图片路径
	 * @param httpRequest
	 * @param request
	 * @return
	 */
	Response getUploadedImg(HttpServletRequest httpRequest,Request request) throws Exception;
	
	/**
	 * 根据目录获取文件列表
	 * @param httpRequest
	 * @param request
	 * @return
	 */
	Response listUploadedImg(HttpServletRequest httpRequest,Request request) throws Exception;
	
	/**
	 * 根据目录获取文件列表
	 * @param httpRequest
	 * @param request
	 * @return
	 */
	Response deleteUploadedImg(HttpServletRequest httpRequest,Request request) throws Exception;
	
	
	
	/**
	 * 组装图片链接
	 * @param domain
	 * @param relateDir
	 * @param fileName
	 * @return
	 */
	String getUrlPath(String domain, String relateDir, String fileName);
	
	/**
	 * 压缩图片
	 * @param filePath
	 * @param fileName
	 * @param uuid
	 */
	void imgResize(String filePath,String fileName);
	
	/**
	 * 获取文件类型
	 * @param multipartFile
	 * @return
	 */
	String getFileSuffix(MultipartFile multipartFile);
	
	/**
	 * 判断文件类型
	 * @param suffix
	 * @return
	 */
	int getFileType(String suffix);

	/**
	 * 下载图片
	 * @param downloadRequest
	 * @return
	 */
	Response doDownloadImg(Request request); 
	
}
